from django.db import models


# Create your models here.
class user(models.Model):
    account = models.CharField(max_length=50)  # 账号
    password = models.CharField(max_length=50)  # 密码
    email = models.EmailField()  # 电子邮箱
    age = models.IntegerField()  # 年龄
    phone = models.CharField(max_length=15)  # 手机号
    rolesOption = (
        ('Admin', 'Admin'),
        ('user', 'user'),
        ('goods', 'goods'),
    )
    username = models.CharField(max_length=50)  # 用户名
    roles = models.Choices(rolesOption)  # 作为一个选择列表

    def __str__(self):
        return self.account
